<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <parameters>
        <parameter key="twig.class">Twig_Environment</parameter>
        <parameter key="twig.loader.filesystem.class">Symfony\Bundle\TwigBundle\Loader\FilesystemLoader</parameter>
        <parameter key="twig.loader.chain.class">Twig_Loader_Chain</parameter>
        <parameter key="templating.engine.twig.class">Symfony\Bundle\TwigBundle\TwigEngine</parameter>
        <parameter key="twig.cache_warmer.class">Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheCacheWarmer</parameter>
        <parameter key="twig.extension.trans.class">Symfony\Bridge\Twig\Extension\TranslationExtension</parameter>
        <parameter key="twig.extension.assets.class">Symfony\Bundle\TwigBundle\Extension\AssetsExtension</parameter>
        <parameter key="twig.extension.actions.class">Symfony\Bundle\TwigBundle\Extension\ActionsExtension</parameter>
        <parameter key="twig.extension.code.class">Symfony\Bridge\Twig\Extension\CodeExtension</parameter>
        <parameter key="twig.extension.routing.class">Symfony\Bridge\Twig\Extension\RoutingExtension</parameter>
        <parameter key="twig.extension.yaml.class">Symfony\Bridge\Twig\Extension\YamlExtension</parameter>
        <parameter key="twig.extension.form.class">Symfony\Bridge\Twig\Extension\FormExtension</parameter>
        <parameter key="twig.extension.httpkernel.class">Symfony\Bridge\Twig\Extension\HttpKernelExtension</parameter>
        <parameter key="twig.extension.debug.stopwatch.class">Symfony\Bridge\Twig\Extension\StopwatchExtension</parameter>
        <parameter key="twig.extension.expression.class">Symfony\Bridge\Twig\Extension\ExpressionExtension</parameter>
        <parameter key="twig.form.engine.class">Symfony\Bridge\Twig\Form\TwigRendererEngine</parameter>
        <parameter key="twig.form.renderer.class">Symfony\Bridge\Twig\Form\TwigRenderer</parameter>
        <parameter key="twig.translation.extractor.class">Symfony\Bridge\Twig\Translation\TwigExtractor</parameter>
        <parameter key="twig.exception_listener.class">Symfony\Component\HttpKernel\EventListener\ExceptionListener</parameter>
        <parameter key="twig.controller.exception.class">Symfony\Bundle\TwigBundle\Controller\ExceptionController</parameter>
        <parameter key="twig.controller.preview_error.class">Symfony\Bundle\TwigBundle\Controller\PreviewErrorController</parameter>
    </parameters>

    <services>
        <service id="twig" class="%twig.class%">
            <argument type="service" id="twig.loader" />
            <argument>%twig.options%</argument>
            <call method="addGlobal">
                <argument>app</argument>
                <argument type="service" id="templating.globals" />
            </call>
        </service>

        <service id="twig.cache_warmer" class="%twig.cache_warmer.class%" public="false">
            <tag name="kernel.cache_warmer" />
            <argument type="service" id="service_container" />
            <argument type="service" id="templating.finder" />
        </service>

        <service id="twig.loader.filesystem" class="%twig.loader.filesystem.class%" public="false">
            <argument type="service" id="templating.locator" />
            <argument type="service" id="templating.name_parser" />
            <tag name="twig.loader"/>
        </service>

        <service id="twig.loader.chain" class="%twig.loader.chain.class%" public="false"/>

        <service id="twig.loader" alias="twig.loader.filesystem" />

        <service id="templating.engine.twig" class="%templating.engine.twig.class%" public="false">
            <argument type="service" id="twig" />
            <argument type="service" id="templating.name_parser" />
            <argument type="service" id="templating.locator" />
        </service>

        <service id="twig.extension.trans" class="%twig.extension.trans.class%" public="false">
            <argument type="service" id="translator" />
        </service>

        <service id="twig.extension.assets" class="%twig.extension.assets.class%" public="false">
            <tag name="twig.extension" />
            <argument type="service" id="service_container" />
            <argument type="service" id="router.request_context" on-invalid="null" />
        </service>

        <service id="twig.extension.actions" class="%twig.extension.actions.class%" public="false">
            <tag name="twig.extension" />
            <argument type="service" id="service_container" />
        </service>

        <service id="twig.extension.code" class="%twig.extension.code.class%" public="false">
            <tag name="twig.extension" />
            <argument>%templating.helper.code.file_link_format%</argument>
            <argument>%kernel.root_dir%</argument>
            <argument>%kernel.charset%</argument>
        </service>

        <service id="twig.extension.routing" class="%twig.extension.routing.class%" public="false">
            <argument type="service" id="router" />
        </service>

        <service id="twig.extension.yaml" class="%twig.extension.yaml.class%" public="false">
            <tag name="twig.extension" />
        </service>

        <service id="twig.extension.debug.stopwatch" class="%twig.extension.debug.stopwatch.class%" public="false">
            <tag name="twig.extension" />
            <argument type="service" id="debug.stopwatch" on-invalid="ignore" />
            <argument>%kernel.debug%</argument>
        </service>

        <service id="twig.extension.expression" class="%twig.extension.expression.class%" public="false">
            <tag name="twig.extension" />
        </service>

        <service id="twig.extension.httpkernel" class="%twig.extension.httpkernel.class%" public="false">
            <argument type="service" id="fragment.handler" />
        </service>


        <service id="twig.extension.form" class="%twig.extension.form.class%" public="false">
            <argument type="service" id="twig.form.renderer" />
        </service>

        <service id="twig.form.engine" class="%twig.form.engine.class%" public="false">
            <argument>%twig.form.resources%</argument>
        </service>

        <service id="twig.form.renderer" class="%twig.form.renderer.class%" public="false">
            <argument type="service" id="twig.form.engine" />
            <argument type="service" id="form.csrf_provider" on-invalid="null" />
        </service>

        <service id="twig.translation.extractor" class="%twig.translation.extractor.class%">
            <argument type="service" id="twig" />
            <tag name="translation.extractor" alias="twig" />
        </service>

        <service id="twig.exception_listener" class="%twig.exception_listener.class%">
            <tag name="kernel.event_subscriber" />
            <tag name="monolog.logger" channel="request" />
            <argument>%twig.exception_listener.controller%</argument>
            <argument type="service" id="logger" on-invalid="null" />
        </service>

        <service id="twig.controller.exception" class="%twig.controller.exception.class%">
            <argument type="service" id="twig" />
            <argument>%kernel.debug%</argument>
        </service>

        <service id="twig.controller.preview_error" class="%twig.controller.preview_error.class%">
            <argument type="service" id="http_kernel" />
            <argument>%twig.exception_listener.controller%</argument>
        </service>
    </services>
</container>
